#这里放的X个文件下的路径，获取后可进行调用
# 导入os包,获取路径
import os
import time
# D:\新建文件夹\pycharm\yesmro\utils\logo_filepath.py
# 1、获取当前执行的脚本文件的绝对路径,也就是logo_filepath.py的绝对路径
# print(os.path.realpath(__file__))
# # 2、获取绝对路径的上一层utils。前面加os.path.dirname()
# print(os.path.dirname(os.path.realpath(__file__)))
# # 3、获取yesmro绝对路径.前面再加前面加os.path.dirname()
# print(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
# # 4、找到yesmro下面的file下的logo.jpg文件,前面再加一个os.path.join()。后面放入路径和文件
# print(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),"file","logo.jpg"))




# 1、对logo.jpg路径进行封装
def get_logo_path():
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),"file","logo.jpg")
    return path
# 调用
# print(get_logo_path())


# 2、对file路径进行封装
def dowload_file_path():
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file")
    return path

if __name__ == '__main__':
    print(dowload_file_path())

#截图功能：
#方法一：文件名固定，每次都会替换，不建议用
# def get_screen_shot_path():
#     path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file", "screen_shot_path.png")
#     return path

#方法二：截图功能，格式式后进行拼接。每次都更新，用年月日时间命名
def get_screen_shot_path():
     file_name = "截图{}.png".format(time.strftime("%Y-%m-%d_%H-%M-%S"))
     path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "file", file_name)
     return path


#3、定义data.yaml的路径
def get_yaml_path():
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),"data","data.yaml")
    return path

if __name__ == '__main__':
    print(get_yaml_path())


#定义日志的路径
def get_log_path():
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "log")
    return path


# config下的settings.ini的路径,
def get_ini_path():
    path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "config","settings.ini")
    return path


